-
Notifications
You must be signed in to change notification settings - Fork 1
Allow debug files in unmet demand scenario #1085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1085 +/- ##
==========================================
+ Coverage 82.26% 82.31% +0.05%
==========================================
Files 53 53
Lines 7416 7409 -7
Branches 7416 7409 -7
==========================================
- Hits 6101 6099 -2
+ Misses 1025 1021 -4
+ Partials 290 289 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enables debug file output for scenarios where dispatch optimization fails due to unmet demand. Previously, when the solver encountered an infeasible model, it would re-run with unmet demand variables to identify problematic markets but would not write debug CSV files. Now, debug information is written for both successful runs and infeasible scenarios before returning an error.
Changes:
- Modified the
runmethod signature from consumingselfto borrowing&self - Ensured debug info is written in both success and infeasible cases
- Inlined the
get_markets_with_unmet_demandhelper function into the main error handling path
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
alexdewar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should panic if the optimisation run with unmet demand variables fails, but other than that, LGTM!
| markets_to_balance, | ||
| /*allow_unmet_demand=*/ true, | ||
| input_prices, | ||
| )?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think this should stay as an expect(), because this optimisation should be the same as the last one, but with unmet demand variables, so if we get an error here something has gone badly wrong.
Description
Slightly reworking things so that we can get debug output files in scenarios with unmet demand
Fixes #1083
Type of change
Key checklist
$ cargo test$ cargo docpresent in the previous release
Further checks